home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / utilities / pu478.dms / pu478.adf / CONVERT / OS 2.0 / ConvertDocs.txt < prev    next >
Text File  |  1993-09-02  |  16KB  |  413 lines

  1.  
  2.  
  3.                       » » » » »  C O N V E R T  « « « « «
  4.  
  5.                          version 2.0, March 3th, 1992
  6.  
  7.                                  User Manual
  8.  
  9.         ***************************************************************
  10.  
  11.                                   Contents
  12.  
  13.                    1. Introduction - What does "Convert" ?
  14.                    2. Getting started
  15.                    3. Working with "Convert"
  16.                    4. Creating own conversion descriptions
  17.                    5. Error messages
  18.                    6. The shell version "Cvt"
  19.  
  20.  
  21.         ***************************************************************
  22.  
  23.  
  24.         1. Introduction
  25.  
  26.  
  27.         "Convert" is a powerful file conversion program. It covers the
  28.         application domain of all ASCII conversion tools between Amiga
  29.         and MS-DOS or any other computer system. This means, that file
  30.         conversion with "Convert" does NOT affect the physical format of
  31.         a file but only its contents. Physical conversion is not subject
  32.         of "Convert" and thus assigned to tools like "CrossDOS".
  33.  
  34.         "Convert" can be used to replace bytes or pairs of bytes in a
  35.         file by another byte or another pair of bytes or by nothing.
  36.         Therefore it can be used for tasks as follows:
  37.  
  38.         - replacing TABs in an ASCII file with blank character(s)
  39.         - stripping controls in an ASCII file
  40.         - converting ASCII-files between Amiga and MS-DOS, MS-DOS and
  41.           Amiga, Amiga and Mac, Mac and Sun, Amiga and Sun etc.
  42.  
  43.         What are "conversion descriptions" ?
  44.  
  45.         All that "Convert" needs, is a set of "replacement records"
  46.         which it can apply to its input files. This set is in the
  47.         following called "conversion description".
  48.         You can create your individual conversion descriptions by
  49.         creating several "replacement records" with a text editor using
  50.         the simple syntax described in chapter 4. These "records" are
  51.         stored to a conversion description file which can be parsed by
  52.         "Convert".
  53.  
  54.         The draft of specifying the conversion by a simple text file
  55.         makes "Convert" more powerful than any other conversion tool
  56.         and thus allows the application of "Convert" for almost all
  57.         conversion problems.
  58.  
  59.  
  60.         ***************************************************************
  61.  
  62.  
  63.         2. Getting started
  64.  
  65.  
  66.         Installation
  67.  
  68.         To install "Convert" double-click the "Install" icon. This short
  69.         shell script will do the following things:
  70.  
  71.         - Copying "reqtools.library" to the LIBS: directory.
  72.         - Copying "Cvt" to the C: directory.
  73.  
  74.         Furthermore, you must have a directory from where "Convert" reads
  75.         its conversion description files. If this directory is not the
  76.         same as the one where "Convert" is placed, you must assign the
  77.         logical device "CVT:" to it.
  78.         If "Convert" starts, first it looks in the current directory for
  79.         conversion descriptions. If it cannot find any matching file
  80.         (with the extension ".cvt"), it tries to get files from "CVT:".
  81.         NOTE: If "Convert" cannot find any description file, it will
  82.         NOT work !
  83.  
  84.  
  85.         Starting "Convert"
  86.  
  87.         You can start "Convert" by entering its name in the shell or by
  88.         double-clicking its icon.
  89.         If the program can locate at least one conversion description,
  90.         it opens a window which contains the control panel of "Convert".
  91.         This panel consists of following elements:
  92.  
  93.         * Source file list *
  94.  
  95.         This list on the left side of the buttons displays the names of
  96.         all files to be converted. The names are shown without path
  97.         name, except if you select two files in different directories
  98.         with the same name. Then the whole path name is displayed.
  99.  
  100.         * Conversion list *
  101.  
  102.         This list on the right side of the buttons displays the names
  103.         of the conversion description files which "Convert" could locate
  104.         at the start. The currently selected conversion description file
  105.         is shown by a high-lighted selection. By default the first name
  106.         of the list is selected.
  107.  
  108.         * Button "Clear" *
  109.  
  110.         You can use this button for deleting the current contents of the
  111.         source file list. If the files in this list have not been
  112.         converted yet, you will be asked to confirm your decision.
  113.  
  114.         * Button "Add files..." *
  115.  
  116.         If you click this button, a file requester will appear. You can
  117.         then select the files which you want to convert by clicking on
  118.         the file names while holding the SHIFT key. In addition there are
  119.         buttons for selecting and de-selecting all files and for pattern
  120.         matching (great, Nico ! :-) ).
  121.         Press the button "Ok" to add the selected files to the source file
  122.         list.
  123.  
  124.         * Button "Remove" *
  125.  
  126.         You can use this button for deleting the currently selected item
  127.         in the source file list. If the files in this list have not been
  128.         converted yet, you will be asked to confirm your decision.
  129.  
  130.         * Button "Start" *
  131.  
  132.         A click on this button starts the conversion process.
  133.  
  134.         * Button "About..." *
  135.  
  136.         Click this button to get short information about "Convert".
  137.  
  138.         * Button "Quit" *
  139.  
  140.         You can use this button for exiting "Convert". If the files in the
  141.         source file list have not been converted yet, you will be asked
  142.         to confirm your decision. You can also quit by clicking in the
  143.         close gadget of "Convert"'s window.
  144.  
  145.         * Cycle-gadget "Replace Original/Target Directory"
  146.  
  147.         This cycle-gadget can be used to toggle between the following two
  148.         modes:
  149.  
  150.         1. replacement mode
  151.         2. duplication mode
  152.  
  153.         The replacement mode is active, when the gadget shows the text
  154.         "Replace Original". Former versions of "Convert" (up to v1.12)
  155.         only provide this mode. In this mode "Convert" replaces the
  156.         original file with the converted version.
  157.         If you choose the duplication mode, a directory requester will
  158.         appear and you have to select a target directory, where "Convert"
  159.         will write the converted files. The name of the target directory
  160.         is then displayed within the cycle-gadget.
  161.  
  162.  
  163.         ***************************************************************
  164.  
  165.  
  166.         3. Working with "Convert"
  167.  
  168.  
  169.         When you have started "Convert" from the shell or from workbench,
  170.         it will open a window which contains a small control panel.
  171.         The source file list on the left side of the buttons is empty,
  172.         so the buttons "Clear" and "Start" are "ghosted".
  173.         Whenever you want to append files to the source file list, press
  174.         the button "Add files". A file requester will appear which allows
  175.         you to select the desired files. Press the "Ok" button to
  176.         append the files to the source file list.
  177.         If you do not want to overwrite the old files with the converted
  178.         versions, then you can specify a target directory for the
  179.         converted files by pressing the cycle-gadget at the botton of the
  180.         window. When you have chosen a target directory, its name will
  181.         be displayed within the gadget.
  182.         Before you start the conversion process, make sure you have
  183.         selected the correct conversion description in the list on the
  184.         right side of the buttons. The current description is shown
  185.         beneath the list.
  186.         The conversion process can be started by pressing the "Start"
  187.         button. "Convert" will open a window which gives you a simple
  188.         trace about the conversion.
  189.         If the conversion description contains no syntax errors, the
  190.         conversion should be performed without any problem. Otherwise
  191.         you have to correct the description file with a text editor.
  192.         At the end "Convert" informs you with a simple requester about
  193.         the success of the conversion process.
  194.         If there were no problems, you can return to the control panel.
  195.         Usually you will want to clear the source file list for the next
  196.         conversion procedure or to quit from "Convert".
  197.  
  198.  
  199.         ***************************************************************
  200.  
  201.  
  202.         4. Creating own conversion descriptions
  203.  
  204.  
  205.         A conversion description file consists of a set of replacement
  206.         records. Such a record describes how a byte or a pair of bytes
  207.         should be replaced by another byte or another pair of bytes or
  208.         by nothing.
  209.         The structure of a conversion description can thus be described
  210.         with the following grammar in EBNF:
  211.  
  212.         ConvDescr = { ReplRec }.
  213.  
  214.         ReplRec   = Primary '->' [ Primary ].
  215.  
  216.         Primary   = Byte [ ',' Byte ]
  217.                   | String.
  218.  
  219.         Byte      = digit { digit }
  220.                   | '"' char '"'.
  221.  
  222.         String    = '"' char char '"'.
  223.  
  224.         Character sets:
  225.           digit = any decimal digit (0-9).
  226.           char  = any character but '"'.
  227.  
  228.         NB.: "Byte" always stands for 1 byte, "String" always stands for
  229.              2 bytes !
  230.  
  231.         Each replacement record must be written in a separate line.
  232.  
  233.         Furthermore a conversion description may contain comments which
  234.         are written like in the programming languages Ada or Eiffel
  235.         (beginning with "--", until end of line). The comments must NOT
  236.         occur after a replacement record.
  237.  
  238.         Example:
  239.  
  240.         -- this is a short example of a conversion description
  241.  
  242.         --replace byte pair (14,37) with byte 121
  243.         14,37->121
  244.         --replace byte 154 with byte 254
  245.         154->254
  246.         --strip byte pair (31,201)
  247.         31,201->
  248.         --replace byte "A" (character) with 13
  249.         "A"->13
  250.         --replace string "RK" with string "SN" (for byte-fanatics)
  251.         "R","K"->"S","N"
  252.         --replace string "<<" with string ">>" (for lazy writers)
  253.         "<<"->">>"
  254.  
  255.         --the following lines are incorrect:
  256.         14,37,->12
  257.         ->13
  258.         20->41 --this comment does not belong to here !
  259.         --string "XX" stands for byte pair, byte "Y" is too much
  260.         "XX","Y"->
  261.         --if you want to convert '"' then use numbers !
  262.         """->22
  263.  
  264.         (end of file)
  265.  
  266.  
  267.         ***************************************************************
  268.  
  269.  
  270.         5. Error Messages
  271.  
  272.  
  273.         "Convert" distinguishes between internal and user errors.
  274.  
  275.         Internal errors are reported by a short output in the shell
  276.         window or a requester with the title "FATAL ERROR". If an
  277.         internal error occurs, the reason may be a lack of memory. The
  278.         execution of "Convert" is immediately terminated and you have
  279.         to increase the free memory size by quitting from another
  280.         application before restarting "Convert".
  281.         There exists one special internal error which is raised, if
  282.         "Convert" cannot find any conversion description files. This
  283.         error is named
  284.  
  285.         "Cannot find a conversion description ! - No conversion possible."
  286.  
  287.  
  288.         User errors are reported in a requester named "Information".
  289.         Errors of this kind may occur during a conversion process.
  290.         In this case "Convert" will stop the process and return to the
  291.         control panel. The user errors are listed below.
  292.  
  293.         "Error in conversion description file in line x"
  294.         "Conversion description file not found"
  295.  
  296.         These errors may occur at the beginning of the conversion process
  297.         when "Convert" tries to open and to parse the current
  298.         conversion description file.
  299.         The first error is reported, whenever a syntax error has been
  300.         encountered in the description file. See chapter 4 for further
  301.         details.
  302.         The second error is reported, when "Convert" cannot open the
  303.         description file. Since the list of description files is built
  304.         at the start of "Convert", another task may have removed the
  305.         requested file.
  306.  
  307.         "File not found or conversion of empty file attempted"
  308.  
  309.         This error may occur during the conversion process, when
  310.         "Convert" cannot open a source file. Another task may have
  311.         removed the file between the selection of the file and the
  312.         beginning of the conversion process.
  313.  
  314.         "Could not get/set file date"
  315.  
  316.         This message appears if the handler process of the device from
  317.         which the source files are read does not understand the SET_DATE
  318.         command. "Convert" tries to save the old date of a file, since
  319.         only the file structure should be changed.
  320.         If the device driver of your harddisk does not support date
  321.         setting, then try the conversion using another device, i.e. RAM:.
  322.  
  323.         "Cannot create temporary file"
  324.  
  325.         In general "Convert" does not save the converted file directly
  326.         over the original file, but creates a temporary file in the same
  327.         directory where the original file is located. If a write-protected
  328.         file with the same name ("CvtTmp_<task address>") exists in this
  329.         directory ,this message tells you that "Convert" will save the
  330.         converted file directly over the original file.
  331.  
  332.         "Cannot write converted file"
  333.  
  334.         If one of the source files is opened for output by another
  335.         task during the conversion process, this error will be reported.
  336.  
  337.         "Cannot lock target directory"
  338.  
  339.         This message may only appear in duplication mode. It indicates
  340.         that "Convert" could not get read access to the specified target
  341.         directory. A possible reason is that there is another task that
  342.         has exclusive (write) access to the directory.
  343.  
  344.         "Internal overflow: too many subdirectories"
  345.  
  346.         This message may only appear in duplication mode. It indicates 
  347.         then the path name of a source file to be converted contains more
  348.         than 20 subdirectory names.
  349.  
  350.  
  351.         ***************************************************************
  352.  
  353.  
  354.         6. The shell version "Cvt"
  355.  
  356.  
  357.         This program is a reduced version of "Convert". It does not
  358.         provide a graphical user interface but accepts all parameters
  359.         from the shell.
  360.  
  361.         If you call "Cvt" without any parameters it will print the
  362.         following short description:
  363.  
  364.         »» Convert «« conversion utility v2.0 for AmigaDOS
  365.         Copyright (C) 1992-1993 by Rainer Koppler
  366.  
  367.         USAGE: Cvt "FILES" <file> { <file> }
  368.                    ("DESCRIPTION"|"DSC") <ConversionDescription>
  369.                    [("TARGET"|"TRG") <TargetDirectory>]
  370.                    ["QUIET"]
  371.  
  372.         If you call "Cvt" with the parameter "?", it will prompt you with
  373.         the following AmigaDOS command template:
  374.  
  375.         FILES/...,DESCRIPTION=DSC/K/A,TARGET=TRG/K,QUIET=Q/S
  376.  
  377.         You then have to enter an argument list according to this template
  378.         or you can enter "?" to get the brief description as shown above.
  379.  
  380.         Description of the parameters:
  381.  
  382.         The parameter represented by the keyword FILES consists of a list
  383.         of names. A name can be any valid AmigaDOS file name or a pattern
  384.         containing AmigaDOS wildcards. All files in this list will
  385.         be converted by "Cvt". The keyword may be omitted.
  386.  
  387.         The parameter with the keyword DESCRIPTION (abbreviated as DSC)
  388.         may not be omitted. It specifies the file name of the conversion
  389.         description (full path name). Note that also the keyword may not
  390.         be omitted.
  391.  
  392.         The parameter TARGET (abbreviated as TRG) is optional. If you
  393.         specify it, "Cvt" will write the converted files to the given
  394.         directory (see "duplication mode", chapter 2). Note that also
  395.         the keyword may not be omitted.
  396.  
  397.         If you wish "Cvt" to produce no output you must specify the
  398.         switch QUIET. It may be abbreviated as "Q".
  399.  
  400.  
  401.         ***************************************************************
  402.  
  403.  
  404.         If you find any bugs or you have any ideas how to improve this
  405.         this product, then contact me:
  406.  
  407.               ///   Rainer Koppler
  408.              ///    Stelzhamerstraße 9
  409.         \\\ ///     A-4623 Gunskirchen
  410.          \\X//      Austria/Europe
  411.  
  412.         internet: rainer@soft.uni-linz.ac.at
  413.